#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   Check_Signal_test.py
@Time    :   2024/01/25 13:31:28
@Author  :   YangLiang 
@Version :   1.0
@Contact :   yangliang@chengtech.com
@License :   (C)Copyright 2022-2025
@Desc    :   None
'''

# here put the import lib
# from lib2to3.pgen2 import driver
from pytest_assume.plugin import assume

import pytest
import logging
import time
from sympy import I
# from sympy import assuming
from commDriver.TS_CAN import *
import allure
import sys
from collections.abc import Iterable
import Set_up

from sqlalchemy import false
sys.dont_write_bytecode = True



class Test_Check_Signal_App(object):

    @allure.severity('normal')
    @allure.story('Session Control Test')
    @allure.title('Test repeat five count session change [1001->1003] with with physical addressing for 0x10')
    @allure.testcase('https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @allure.description('Test session change session in 1001->1003')
    def test_check_0x15c_Phy(self, action, Driver):
        iStep = 1
        for i in range(3):
            Set_up.MRR_0x15C_data.clear()
            time.sleep(1.2)
            corrRespStr = binascii.b2a_hex(bytearray(Set_up.MRR_0x15C_data[0:8]), ' ')
            logging.error('0x15C data:[{0}]'.format(corrRespStr))
            with assume: assert Set_up.MRR_0x15C_data == Set_up.ECUSoftwareVersionNumber

    @allure.severity('normal')
    @allure.story('Session Control Test')
    @allure.title('Test repeat five count session change [1001->1003] with with physical addressing for 0x10')
    @allure.testcase('https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @allure.description('Test session change session in 1001->1003')
    def test_check_0x15d_Phy(self, action, Driver):
        iStep = 1
        for i in range(3):
            Set_up.MRR_0x15D_data.clear()
            time.sleep(1.2)
            corrRespStr = binascii.b2a_hex(bytearray(Set_up.MRR_0x15D_data[0:8]), ' ')
            logging.error('0x15D data:[{0}]'.format(corrRespStr))
            with assume: assert Set_up.MRR_0x15D_data[0] == 1
            